package com.pur.zsms.common.filter;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MemcacheServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/*
	 * @Autowired private GlobalCacheService globalCacheService;
	 */

	/**
	 * @see HttpServlet#HttpServlet()
	 */
	public MemcacheServlet() {
		super();

	}

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
	        IOException {
		/*
		 * String flag = request.getParameter("flag");
		 * globalCacheService.test(); if ("q".equals(flag)) { // 取缓存 String name
		 * = (String) globalCacheService.getCacheValue("_name1", Object.class);
		 * System.out.println("执行取缓存操作： " + name); } else if ("f".equals(flag))
		 * { // 放缓存 String username = request.getParameter("username");
		 * globalCacheService.deleteCacheValue("_name1"); if
		 * (!StringUtil.isBlank(username)) { System.out.println("执行存缓存操作： " +
		 * username); globalCacheService.setCacheValue("_name1", username,
		 * 28800); } else { System.out.println("执行存缓存操作： " + username);
		 * globalCacheService.setCacheValue("_name1", "lzx", 28800); } }
		 */
		super.doGet(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
	        IOException {
		super.doPost(request, response);
	}

	@Override
	public void destroy() {
		// TODO Auto-generated method stub
		super.destroy();
	}

	@Override
	public void init() throws ServletException {
		// TODO Auto-generated method stub
		super.init();
	}

}
